﻿@model IEnumerable<Angel.Web.Models.FilterUser>             
@using Angel.Entities;
@{
    var page = (int)ViewBag.page;
    var total = (int)ViewBag.total;
    int stt = 0;
}

@{
    if (Model.Count() == 0)
    {
        <h5 style="color : Red">Display 0 result</h5>
    }
    else
    {
         <div class="aui-group count-pagination">
    <div class="results-count aui-item">
        Displaying users <span class="results-count-start">1</span> to <span>@ViewBag.numberUserDisplay</span> of <strong class="results-count-total">@ViewBag.NumberUsers</strong>.
    </div>

</div>
<table class="aui aui-table-rowhover" id="user_browser_table">
    <thead>
        <tr>
            <th>No.</th>
            <th> Username</th>
            <th> Full Name</th>
            <th class="minNoWrap">Login Details </th>
            <th> Groups</th>
            <th>Directory</th>
            <th class="minNoWrap">Operations</th>
        </tr>
    </thead>
    <tbody>
   @foreach (var item in Model)
   {
         stt = stt + 1;
        <tr class="vcard">
            <td>@stt</td>
            <td><div><a id="" rel="" class="user-hover user-avatar" style="background-image:url('/Content/images/useravatar.png');" href="#"><span class="username">@Html.DisplayFor(model => item.UserName)</span></a></div></td>
            <td>
                <span class="fn">@Html.DisplayFor(model => item.FullName)</span><br />
                <a href="#"><span class="email">@Html.DisplayFor(model => item.Email)</span></a>
            </td>
            <td class="minNoWrap">
                  Not recorded 
            </td>
            <td>
                <ul>
                @{
                    foreach (Group g in item.Groups)
                      {
                        <li><a href="#" style="padding-left:5px; line-height:20px; list-style:nomal;">@g.GroupName</a> </li>
                      }
                 }
                </ul>
            </td>
            <td>JIRA Internal Directory</td>
            <td>
                <ul class="operations-list">
                <li>@Html.ActionLink("Groups", "Index", "Group", new { id = item.UserID }, new { @class = "editgroups_link", @id = "editgroups" })</li>
                <li>@Html.ActionLink("Project Roles", "Index", "ProjectRole", new { id = item.UserID }, new { @id = "projectroles_link" })</li>
                <li>@Html.ActionLink("Edit", "Edit", new { id = item.UserID }, new { @id = "edituser_link" })</li>
                <li>@Html.ActionLink("Delete", "Delete", new { id = item.UserID }, new { @id = "deleteuser_link" })</li>
                </ul>
            </td>
        </tr>
   }
    </tbody>
</table>
 <div style="margin: 1.5em;">
    
    @if (page > 1)
    {
        <a href="#" onclick="javascript:OnCriteria(@(page - 1));"><span style="font-weight:bold">Previous</span></a>
    }
    @if (page < total)
    {
       <a href="#" onclick="javascript:OnCriteria(@(page + 1));"><span style="font-weight:bold">Next</span></a>
    }
</div>
    }
   

}

